function zdcqOpera(whichButton)
{
	var gongChengXMID = document.getElementById("gongChengXMID").value;
	var zhengDiCQID = document.getElementById("zhengDiCQID").value;
	if (whichButton.getAttribute("title") == "add") {
		zdcqOperaForm.action = "ZhengDiCQ_Insert.jsp?gongChengXMID=" + gongChengXMID ;
		zdcqOperaForm.submit();
	} else if (whichButton.getAttribute("title") == "update") {
		if (zhengDiCQID) {
			zdcqOperaForm.action = "viewZhengDiCQ?ID=" + zhengDiCQID + "&viewOrUpdate=update";
			zdcqOperaForm.submit();
		} else {
			alert("请选择要修改的征地拆迁信息");
		}
	} else if (whichButton.getAttribute("title") == "delete") {
		if (zhengDiCQID) {
			zdcqOperaForm.action = "deleteZhengDiCQ?ID=" + zhengDiCQID + "&GongChengXMID=" + gongChengXMID;
			zdcqOperaForm.submit();
		} else {
			alert("请选择要删除的征地拆迁信息");
		}
	} else if (whichButton.getAttribute("title") == "view") {
		zdcqOperaForm.action = "viewZhengDiCQ?ID=" + zhengDiCQID + "&viewOrUpdate=view";
		zdcqOperaForm.submit();
	}
}

function selectZhengDiCQID(whichButton) {
	var checkbox = document.getElementsByName("checkbox");
	for (var i = 0; i < checkbox.length; i++) {
		if (checkbox[i].id == whichButton.id) {
			checkbox[i].checked = true;
			document.getElementById("zhengDiCQID").value = whichButton.id;
		} else {
			checkbox[i].checked = false;
		}
	}
}

function setDate() {
	var jiLuSJ = document.getElementById("jiLuSJ").getAttribute("value");
	var chaiQianSJ = document.getElementById("chaiQianSJ").getAttribute("value");
	document.getElementById("DS_JiLuSJ").setAttribute("value", jiLuSJ);
	document.getElementById("DS_ChaiQianSJ").setAttribute("value", chaiQianSJ);
}

function homePage() {
	var pageSize = document.getElementById("pageSize").value;
	myForm2.action="listZhengDiCQ?pageSize=" + pageSize + "&pageNum=1";
	myForm2.submit();
}
function prePage() {
	var pageSize = document.getElementById("pageSize").value;
	var currentPage = document.getElementById("currentPage").value;
	if (currentPage <= 1) {
		currentPage = (1 + 1);
	}
	myForm2.action="listZhengDiCQ?pageSize=" + pageSize + "&pageNum=" + (parseInt(currentPage)-parseInt('1'));
	myForm2.submit();
}
function nextPage() {
	var pageSize = document.getElementById("pageSize").value;
	var currentPage = document.getElementById("currentPage").value;
	var totalPage = document.getElementById("totalPage").value;
	if (currentPage >= totalPage ) {
		currentPage = (parseInt(totalPage) - parseInt('1'));
	}
	myForm2.action="listZhengDiCQ?pageSize=" + pageSize + "&pageNum=" + (parseInt(currentPage)+parseInt('1'));
	myForm2.submit();
}
function endPage() {
	var pageSize = document.getElementById("pageSize").value;
	var totalPage = document.getElementById("totalPage").value;
	myForm2.action="listZhengDiCQ?pageSize=" + pageSize + "&pageNum=" + totalPage;
	myForm2.submit();
	
}